Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] fixing #2898: no error output if dynamic component with ssr: false crashes #3009

Closed
wants to merge 8 commits into from

Conversation

Jabher
Copy link

@Jabher Jabher commented Sep 28, 2017

This commit is fixing issue #2898 by adding simple .catch wrapper with window.next.renderError call

@Jabher Jabher changed the title fixing #2898 fixing #2898: no error output if dynamic component with ssr: false crashes Sep 28, 2017
@Jabher
Copy link
Author

Jabher commented Oct 11, 2017

Guys, wtf? It is real bug, that is actually making life painful for some people, issue was reported month ago, fix was created 2 weeks ago and you even not commented yet, bug is reproducible and fix is really obvious.

And not even a word was spoken :(

@@ -71,6 +71,13 @@ export default function dynamicComponent (p, o) {
this.state.AsyncComponent = AsyncComponent
}
})
.catch(
this.ssr
? undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this silently swallow the error when it happens server side? 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it would not make anything worse than it is. Both .catch(cb?) and .then(cb?) are actually a wrappers around .then(successHandler?, errorHandler?). Let me explain it with shell example:

# jabher @ DESKTOP-DTTUH1G in /mnt/c/Users/jabher [1:05:39]
$ node
> process.on("unhandledRejection", console.warn.bind(null, 'in uncaught rejecton')); void 0
undefined
> Promise.reject('test').catch(undefined); void 0
undefined
> in uncaught rejecton test Promise {
  <rejected> 'test',
  domain:
   Domain {
     domain: null,
     _events: { error: [Function: debugDomainError] },
     _eventsCount: 1,
     _maxListeners: undefined,
     members: [] } }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice! 👌 So returning undefined actually will bubble it up 😄 TIL 👍

@timneutkens
Copy link
Member

timneutkens commented Oct 11, 2017

Hey 👋,
First of all thanks for your contribution 🙌 ❤️

Guys, wtf? It is real bug

Lets start by pointing to this: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

Specifically:

Using welcoming and inclusive language

It is real bug, that is actually making life painful for some people

Sorry to hear that!

issue was reported month ago

As you can see at the moment we have 193 issues, and I'm maintaining Next outside of my day job, meaning all the time I spend outside of work goes towards pushing Next forward.

fix was created 2 weeks ago and you even not commented yet

We've been busy preparing the release of Next v4. Unfortunately I haven't had time to look into all (38) open pull requests. Including yours. I did see your PR though, and assigned Arunoda to review it. I've just sent him a private message asking him to check it out 😄

Again, sorry for your trouble, just trying to explain the context as to why this happened 😄

I've review the PR myself too, just checking if the catch you've added does what we expect it will do 😄 👌

@albinekb
Copy link
Contributor

@Jabher if you need this now now now, why not yarn link it? Or point your package.json to your fork? 🤔

@Jabher
Copy link
Author

Jabher commented Oct 11, 2017

@timneutkens

Guys, wtf? It is real bug

Lets start by pointing to this: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

On one hand - I totally agree about this. On other - everyone answered after a month only when I told that word.
I've seen lots of approaches in working with contributors, but simply ignoring them is really horrible thing. All of "we will look at it later", "sorry, but we don't need it" and "it's not in our code style" are fine, but simply selectively ignoring PRs makes people feel that it is not actually an open-source with community engagement, but public "club of friends".

So, sorry about that, but I was really tired about checking if someone aswered me with at least "not going into sources, make your own fork". Obviously, I wanted to keep on with master and all the community 😅

@Jabher if you need this now now now, why not yarn link it? Or point your package.json to your fork? 🤔

@albinekb next is developing rapidly, I've started a project on 4.0 beta few weeks ago totally sure that it will go in release within few months. And rebasing this commit every second day sounds like not very good option.

@albinekb
Copy link
Contributor

albinekb commented Oct 11, 2017

Yeah, totally reasonable @Jabher 👍 Well answered. Let's get this one going @timneutkens 🥇 There have just been a lot going on at zeit this month with zeit.co/day, so I can assure you that no one is selectively ignores any PRs :)

@Jabher
Copy link
Author

Jabher commented Oct 11, 2017

Ah, right, zeit conf. Now everything looks extremely reasonable, I know how much power the conf takes, sorry for that 🙌

@arunoda
Copy link
Contributor

arunoda commented Oct 12, 2017

This is a good check and I think we should ship this ASAP. But before that, I'd like to have a test case for this.
(Here's the place we do it.)

If you have don't time, just tell me. I'll work on it.
Thanks.

@timneutkens
Copy link
Member

timneutkens commented Oct 12, 2017

@Jabher 👌

On one hand - I totally agree about this. On other - everyone answered after a month only when I told that word.

A simple ping would have been enough 👌😄 Basically I go through all my notifications every day and respond to everything 👍

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ignore this for now 😄 Had to run, I usually commit after mostly every significant action. Will squash and cleanup everything when it will be ready!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thaaaaaaaanks! 🎉

@Jabher
Copy link
Author

Jabher commented Oct 20, 2017

Guys, sorry, but I feel I'm stuck - I cannot figure out how to test this, I've tried several different approaches, but none worked.

@timneutkens
Copy link
Member

@Jabher if you make sure the build succeeds we'll add the test later 👍

@timneutkens timneutkens changed the base branch from master to canary November 23, 2017 13:00
@timneutkens timneutkens changed the title fixing #2898: no error output if dynamic component with ssr: false crashes [WIP] fixing #2898: no error output if dynamic component with ssr: false crashes Nov 23, 2017
@timneutkens timneutkens closed this Apr 1, 2018
@vjpr vjpr mentioned this pull request May 7, 2018
1 task
@lock lock bot locked as resolved and limited conversation to collaborators Apr 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants